<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title></title>
  </head>
  <body>
    <video id="video1" style="object-fit: fill" width="640" height="360" controls autoplay autobuffer muted="false" preload="auto" ></video>
    <!-- <video id="video2" style="object-fit: fill" width="640" height="360" controls autoplay autobuffer muted="false" preload="auto" ></video>
    <video id="video3" style="object-fit: fill" width="640" height="360" controls autoplay autobuffer muted="false" preload="auto" ></video>
    <video id="video4" style="object-fit: fill" width="640" height="360" controls autoplay autobuffer muted="false" preload="auto" ></video>
    <video id="video5" style="object-fit: fill" width="640" height="360" controls autoplay autobuffer muted="false" preload="auto" ></video>
    <video id="video6" style="object-fit: fill" width="640" height="360" controls autoplay autobuffer muted="false" preload="auto" ></video> -->
    <script type="text/javascript" src="webrtcstreamer.js"></script>
    <script type="text/javascript" src="adapter.min.js"></script>
    <script>
      var webRtcServer1 = null;
      // var webRtcServer2 = null;
      // var webRtcServer3 = null;
      // var webRtcServer4 = null;
      // var webRtcServer5 = null;
      // var webRtcServer6 = null;
      //页面加载时加载视频画面
      window.onload = function () {
        //video：需要绑定的video控件ID
        //192.168.1.226：启动webrtc-streamer的设备IP
        webRtcServer1 = new WebRtcStreamer(
          "video1",
          "http://127.0.0.1:8000"
          // "http://192.168.0.111:8000"
        );
        // webRtcServer2 = new WebRtcStreamer("video2", "http://127.0.0.1:8000");
        // webRtcServer3 = new WebRtcStreamer("video3", "http://127.0.0.1:8000");
        // webRtcServer4 = new WebRtcStreamer("video4", "http://127.0.0.1:8000");
        // webRtcServer5 = new WebRtcStreamer("video5", "http://127.0.0.1:8000");
        // webRtcServer6 = new WebRtcStreamer("video6", "http://127.0.0.1:8000");
        // webRtcServer.connect("rtsp://admin:thzn123456@192.168.0.13:554/h264/ch1/main/av_stream");
        // "rtsp://admin:jiapu123@192.168.0.204:554/h264/ch1/main/av_stream" //小白兔
        // trsp "" 优化
        // webRtcServer1.connect("rtsp://admin:jiapu123@192.168.0.204:554/h264/ch1/main/av_stream","","rtptransport=tcp");
        webRtcServer1.connect("rtsp://admin:123456@192.168.3.137/main","","rtptransport=tcp");
        // webRtcServer2.connect("rtsp://admin:123456@192.168.3.146/main","","rtptransport=tcp");
        // webRtcServer3.connect("rtsp://admin:123456@192.168.3.147/main","","rtptransport=tcp");
        // webRtcServer4.connect("rtsp://admin:123456@192.168.3.148/main","","rtptransport=tcp");
        // webRtcServer5.connect("rtsp://admin:123456@192.168.3.149/main","","rtptransport=tcp");
        // webRtcServer6.connect("rtsp://admin:123456@192.168.3.150/main","","rtptransport=tcp");
      };

      //页面退出时销毁
      window.onbeforeunload = function () {
        webRtcServer1.disconnect();
        // webRtcServer2.disconnect();
        // webRtcServer3.disconnect();
        // webRtcServer4.disconnect();
        // webRtcServer5.disconnect();
        // webRtcServer6.disconnect();
      };
    </script>
  </body>
</html>
